﻿@page "/result"
@using Sve.Blazor.InfiniteScroll.Components
@using MG.Library.Services

@inject IMGStorage _mgStorage
@inject INavigaitionService _navigaitionService
<Button OnClick='() =>_navigaitionService.NavigateTo("/detail/1")' >查看详情</Button>
<InfiniteScroll ObserverTargetId="observerTarget"
                ObservableTargetReached="_ => LoadMoreAsync()">
    @foreach (var mg in _mgs)
    {
        <div>
            <Card>
                <BodyTemplate>
                    <span style="font-weight:bold;color:#0078d4">@mg.Question</span>
                    <div class="shim-2xs"></div>
                    @mg.Answer1
                    <div class="shim-2xs"></div>
                    @mg.Answer2
                    <div class="shim-2xs"></div>
                    @mg.Answer3
                    <div class="shim-2xs"></div>
                    @mg.Answer4
                </BodyTemplate>
            </Card>
        </div>
        <div class="shim-xl"></div>
    }
    <div id="observerTarget">
        @_status 
    </div>
</InfiniteScroll>